<?php

/**
 * Capital Direct Lending (http://www.philbsd.com/cdl)
 *
 * Copyright (C) 2008 Philippine Business Solution Developers <http://www.philbsd.com>
 * All rights reserved.
 *
 *
 * LICENSE
 *
 * This source file is subject to the GNU General Public License v3 license
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-3.0.txt
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@philbsd.com so we can send you a copy immediately.
 *
 * @copyright  (c) 2008 Philippine Business Solution Developers. (http://www.philbsd.com)
 * @license    http://www.gnu.org/licenses/gpl-3.0.txt
 * @version    $Id: edit.phtml 42 2008-03-12 10:05:35Z philbsd $
 */

?><div class="middle">
	<div class="simple-container-left" id="page:main-container">
		<div class="container" id="page:container">
			<div class="main">
				<div class="content-container">
					<div class="content" id="content">
						<div class="content-header">
							<table class="grid-header" cellspacing="0" >
								<tbody>
									<tr>
										<td style=""><h3 class="icon-head head-customer"><?php echo isset($this->id)? 'Edit Loan': 'New Loan'; ?></h3></td>
										<td class="a-right">
											<button type="button" class="scalable back" onclick="setLocation('<?php echo $this->baseUrl; ?>/loan')" style=""><span>Back</span></button>
											<button type="button" class="scalable" onclick="setLocation(window.location.href)" style=""><span>Reset</span></button>
											<button type="button" class="scalable save" onclick="editForm.submit();" style=""><span>Save Loan</span></button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div id="messages"></div>

						<form name="form1" id="form1" action="/" method="post">
						<div class="entry-edit">
							<h4 class="icon-head head-edit-form fieldset-legend">Loan Information</h4>
							<fieldset>
								<table width="100%" cellspacing="0">
								<tbody>
							        <tr>
							        <td>
								<table width="100%" cellspacing="5"i border="0">
								<tbody>
								<tr>
								    <td width="25%">Loan ID Number <span class="required">*</span></td>
                                                                     							<td><em>Autogenerated</em></td>
														</tr>
														<tr>
															<td>Borrower ID <span class="required">*</span></td>
															<td>
                                                                                                                                    <select id="_loan_borrower_id" name="loan[borrower_id]" class="required-entry required-entry select" type="select">
																<option value="1">20080001 - Person A</option>
																<option value="2">20080002 - Person B</option>
																<option value="3">20080003 - Person C</option>
																</select>
                                                                                                                            </td>
														</tr>
														<tr>
															<td>Co-Borrower ID <span class="required">*</span></td>
															<td>
                                                                                                                                    <select id="_loan_coborrower_id" name="loan[coborrower_id]" class="required-entry required-entry select" type="select">
																<option value="1">20080001 - Person A</option>
																<option value="2">20080002 - Person B</option>
																<option value="3">20080003 - Person C</option>
																</select>
                                                                                                                            </td>
														</tr>
														<tr>
															<td>Collector ID <span class="required">*</span></td>
															<td>
                                                                                                                                    <select id="_loan_collector_id" name="loan[collector_id]" class="required-entry required-entry select" type="select">
																<option value="1">0001 - Collector A</option>
																<option value="2">0002 - Collector B</option>
																<option value="3">0003 - Collector C</option>
																</select>
                                                                                                                            </td>
														</tr>
														<tr>
															<td>Loan Type<span class="required">*</span></td>
															<td>
																			<table>
																	<tbody>
																		<tr>
																			<td>
																				<input type="radio" name="id_type" checked="checked" value="auto" onClick="changeIdType('id_auto');"> regular loan
																			</td>
																			<td>
																				<div id="id_auto" style="position:relative;">
																					&nbsp; &nbsp;
																					  <select id="_loan_chart_id" name="loan[chart_id]" class="required-entry required-entry select" type="select">
																                                          <option value="1"> 30,000 </option>
								                                                                                                          <option value="2"> 27,000 </option>
                                                                                                                                                                          <option value="3"> 24,000 </option>
                                                                                                                                                                              <option value="1"> 21,000 </option>
								                                                                                                          <option value="2"> 18,000 </option>
                                                                                                                                                                          <option value="3"> 15,000 </option>
                                                                                                                                                                              <option value="1"> 12,000 </option>
								                                                                                                          <option value="2"> 10,200 </option>
                                                                                                                                                                          <option value="3"> 8,400 </option>
                                                                                                                                                                              <option value="1"> 7,200 </option>
								                                                                                                          <option value="2"> 6,000 </option>
                                                                                                                                                                          <option value="3"> 4,200 </option>
                                                                                                                                                                          <option value="3"> 3,000 </option>
																                                          </select>

																				</div>
																			</td>
																		</tr>
																		<tr>
																			<td>
																				<input type="radio" name="id_type" value="manual" onClick="changeIdType('id_manual');"> custom loan																				</td>
               	<td>
                 <div id="id_manual" style="float:left;">
																				&nbsp; &nbsp;
																				</div>
																			</td>
																		</tr>
																	</tbody>
																</table>
																<script type="text/javascript"><!--
																	function changeIdType(divName) {
																		var showDivName = divName, hideDivName = '';
																		if (divName == 'id_auto') {
																			hideDivName = 'id_manual';
																		} else if (divName == 'id_manual') {
																			hideDivName = 'id_auto';
																		} else {
																			return;
																		}
																		if (document.getElementById) { // DOM3 = IE5, NS6
																			document.getElementById(showDivName).style.visibility = 'visible';
																			document.getElementById(hideDivName).style.visibility = 'hidden';
																		} else {
																			if (document.layers) { // Netscape 4
																				eval( "document." + showDivName + ".visibility = 'visible'");
																				eval( "document." + hideDivName + ".visibility = 'hidden'");
																			} else { // IE 4
																				eval( "document.all." + showDivName + ".style.visibility = 'visible'");
																				eval( "document.all." + hideDivName + ".style.visibility = 'hidden'");
																			}
																		}
																	}
																	changeIdType('id_auto');
																	//-->
																</script>

															</td>
														</tr>
														</td>
														</tr>
														<tr>
															<td>Start Date <span class="required">*</span></td>
															<td><input id="_loan_start_date" name="loan[start_date]" value="" class="required-entry required-entry input-text" type="text"></td>
														</tr>
														<tr>
															<td>Loan Status <span class="required">*</span></td>
															<td>
																<select id="_loan_status_id" name="loan[status_id]" class="required-entry required-entry select" type="select">
																<option value="1">Inquiry</option>
																<option value="2">Application</option>
																<option value="1">Pending Approval</option>
																<option value="2">Pending Release</option>
																<option value="1">In Repayment</option>
																<option value="2">Paid In Full</option>
																<option value="1">Default</option>
																<option value="2">Denied</option>
																</select>
															</td>
														</tr>
														<tr>
															<td>Total Loan Amount <span class="required">*</span></td>
															<td><input id="_loan_total_amount" name="loan[total_amount]" value="" class="required-entry required-entry input-text" type="text"></td>
														</tr>
														<tr>
															<td>Principal <span class="required">*</span></td>
															<td><input id="_loan_principal" name="loan[principal]" value="" class="required-entry required-entry input-text" type="text"></td>
														</tr>
														<tr>
															<td>Interest <span class="required">*</span></td>
															<td><input id="_loan_interest" name="loan[interest]" value="" class="required-entry required-entry input-text" type="text"></td>
														</tr>
														<tr>
															<td>Loan Payment <span class="required">*</span></td>
															<td><input id="_loan_payment" name="loan[payment]" value="" class="required-entry required-entry input-text" type="text"></td>
														</tr>
														<tr>
															<td>Monthly Approved <span class="required">*</span></td>
															<td><input id="_loan_mothly_approved" name="loan[monthly_approved]" value="" class="required-entry required-entry input-text" type="text"></td>
														</tr>
														<tr>
															<td>Surcharge <span class="required">*</span></td>
															<td><input id="_loan_srcharge" name="loan[surcharge]" value="" class="required-entry required-entry input-text" type="text"></td>
														</tr>

													</tbody>
												</table>
									</tbody>
								</table>

							</fieldset>
							<div align="center">
								<button type="button" class="scalable back" onclick="setLocation('<?php echo $this->baseUrl; ?>/loan')" style=""><span>Back</span></button>
								<button type="button" class="scalable" onclick="setLocation(window.location.href)" style=""><span>Reset</span></button>
								<button type="button" class="scalable save" onclick="editForm.submit();" style=""><span>Save Loan</span></button>
							</div>

						</div>


						</form>
					</div>
				</div>

				<div class="section-menu" id="page:left">
					<h3>Loan Center</h3>
					<ul id="loan_info_tabs" class="tabs">
						<li>
					        <a href="<?php echo $this->baseUrl; ?>/loan" title="Loan" class="tab-item-link active">
				            <span><div class="changed" title="The information in this tab has been changed."></div><div class="error" title="This tab contains invalid data. Please solve the problem before saving.">
							</div>Loan</span>
					        </a>
					    </li>
					    <li>
					        <a href="<?php echo $this->baseUrl; ?>/payments" title="View Loans" class="tab-item-link">
				            <span><div class="changed" title="The information in this tab has been changed."></div><div class="error" title="This tab contains invalid data. Please solve the problem before saving.">
							</div>Payments</span>
					        </a>
					    </li>
					</ul>
					<div class="bottom"></div>
				</div>
          	</div>
		</div>
	</div>
</div>